import api from '@/service/api';
import { PaginationOutput } from '@/types';

type Params = {
  page: number;
  limit: number;
  state?: 1 | 2,
  classifyName?: string;
};

interface CreateUser {
  _id: string;
  nickName: string;
}

export interface ListItem {
  _id: string;
  code: string;
  name: string;
  imgUrl: string;
  createUser: CreateUser;
  createdAt: string;
  updatedAt: string;
}

export type Output = PaginationOutput<ListItem>;

export default (params: Params) => {
  return api.get('/api/image/image/list', { params }) as Promise<Output>;
}
